package com.qyx.pmpucat.util;

import cn.dev33.satoken.session.SaSession;
import cn.dev33.satoken.stp.StpUtil;
import com.qyx.pmpucat.entity.User;


public class UserContext {

    public static User getUser() {
        SaSession session = StpUtil.getSession(false);
        return (User) session.get("user");
    }


    public static Long getUserId() {
        User user = getUser();
        return user != null ? user.getId() : null;
    }

}
